﻿using Architecture.Api.Application.Command.RoleCommand;
using Architecture.Service;
using MediatR;

namespace Architecture.Api.Application.CommandHandlers.RoleHandler
{
    public class SectorBackfillCommandHandler : IRequestHandler<SectorBackfillCommand, object>
    {
        private readonly IRoleService _roleService;

        public SectorBackfillCommandHandler(IRoleService roleService)
        {
            _roleService = roleService;
        }

        public async Task<object> Handle(SectorBackfillCommand request, CancellationToken cancellationToken)
        {
            return await _roleService.GetRelatedFan(request.RoleId);
        }
    }
}
